import { mockAjax, testAjax } from '@/utils/request';

// export async function sendMessage(): Promise<any> {
//   return mockAjax('/api/sendMessages', {
//     method: 'POST',
//     headers: {
//       loading: false,
//     },
//   });
// }

export async function mockMessageList(params: object): Promise<any> {
  return mockAjax('/api/tableList', {
    params,
    // headers: {
    //   loading: false,
    // },
  });
}

export async function mockechars(): Promise<any> {
  return mockAjax('/api/echars', {});
}

export async function classList(params: object): Promise<any> {
  return testAjax('/admin/clases', {
    params,
  });
}

export async function addClases(data: object): Promise<any> {
  return testAjax('/admin/clases', {
    data,
    method: 'POST',
  });
}

export async function editClases(data: any): Promise<any> {
  return testAjax({
    method: 'PUT',
    url: `/admin/clases/${data.id}`,
    data,
  });
}

export async function delClases(params: object): Promise<any> {
  return testAjax(`/admin/clases/${params}`, {
    method: 'DELETE',
  });
}

export async function msgList(params: object): Promise<any> {
  return testAjax('/admin/messages', {
    params,
  });
}

export async function gradesList(params: object): Promise<any> {
  return testAjax('/admin/grades', {
    params,
  });
}

export async function parentsList(params: object): Promise<any> {
  return testAjax('/admin/parents', {
    params,
  });
}

export async function getTeacher(params: object): Promise<any> {
  return testAjax('/admin/teachers', {
    params,
  });
}

export async function studentsList(params: object): Promise<any> {
  return testAjax('/admin/students', {
    params,
  });
}

export async function batchesList(params: object): Promise<any> {
  return testAjax('/admin/disciplines', {
    params,
  });
}

export async function editBatches(data: any) {
  return testAjax({
    method: 'PUT',
    url: `/admin/disciplines/${data.id}`,
    data,
  });
}

export async function editStudents(data: any) {
  return testAjax({
    method: 'PUT',
    url: `/admin/students/${data.id}`,
    data,
  });
}

export async function messageType(params: object): Promise<any> {
  return testAjax('/admin/message_types', {
    params,
  });
}

export async function sendMessage(data: object): Promise<any> {
  return testAjax('/admin/messages', {
    data,
    method: 'POST',
  });
}

export async function scoresList(params: object): Promise<any> {
  return testAjax('/admin/scores', {
    params,
  });
}

export async function delScores(params: object): Promise<any> {
  return testAjax(`/admin/scores/${params}`, {
    method: 'DELETE',
  });
}

export async function editScores(data: any) {
  return testAjax({
    method: 'PUT',
    url: `/admin/scores/${data.id}`,
    data,
  });
}

export async function leavesList(params: object): Promise<any> {
  return testAjax('/admin/leaves', {
    params,
  });
}

export async function teacherLeaves(params: object): Promise<any> {
  return testAjax('/admin/leaves?role_id=2', {
    params,
  });
}

export async function studentsLeaves(params: object): Promise<any> {
  return testAjax('/admin/leaves?role_id=3', {
    params,
  });
}

export async function editLeavesL(data: any) {
  return testAjax({
    method: 'PUT',
    url: `/admin/leaves/${data.id}`,
    data,
  });
}

export async function usersList(params: object): Promise<any> {
  return testAjax('/admin/users', {
    params,
  });
}

export async function delUsers(params: object): Promise<any> {
  return testAjax(`/admin/users/${params}`, {
    method: 'DELETE',
  });
}

export async function rolesList(params: object): Promise<any> {
  return testAjax('/admin/roles', {
    params,
  });
}

export async function EditRoles(data: object): Promise<any> {
  return testAjax('/admin/users/roles', {
    data,
    method: 'POST',
  });
}

export async function editUser(data: any) {
  return testAjax({
    method: 'PUT',
    url: `/admin/users/${data.id}`,
    data,
  });
}

export async function uploadStudent(data: object): Promise<any> {
  return testAjax('/admin/students/batches', {
    data,
    method: 'POST',
  });
}

export async function uploadScores(data: object): Promise<any> {
  return testAjax('/admin/scores/batches', {
    data,
    method: 'POST',
  });
}

export async function getDashboard(): Promise<any> {
  return testAjax('/admin/dashboards');
}

export async function batchDelUsers(data: object): Promise<any> {
  return testAjax('/admin/users/delete', {
    data,
    method: 'POST',
  });
}

export async function delStudent(params: object): Promise<any> {
  return testAjax(`/admin/students/${params}`, {
    method: 'DELETE',
  });
}

export async function Editstudents(data: any): Promise<any> {
  return testAjax({
    method: 'PUT',
    url: `/admin/students/${data.id}`,
    data,
  });
}

export async function schedulesList(params: object): Promise<any> {
  return testAjax('/admin/schedules', {
    params,
  });
}

export async function delSchedulest(params: object): Promise<any> {
  return testAjax(`/admin/schedules/${params}`, {
    method: 'DELETE',
  });
}

export async function editSchedulest(data: any): Promise<any> {
  return testAjax({
    method: 'PUT',
    url: `/admin/schedules/${data.id}`,
    data,
  });
}

export async function addSchedulest(data: object): Promise<any> {
  return testAjax('/admin/schedules', {
    data,
    method: 'POST',
  });
}

export async function payment(params: object): Promise<any> {
  return testAjax('/admin/payment_logs', {
    params,
  });
}

export async function payMoney(data: object): Promise<any> {
  return testAjax('/admin/payment_logs', {
    data,
    method: 'POST',
  });
}
